<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>1.姓名案例_插值语法实现</title>
    <!--  引入Vue  -->
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <!--  准备好一个容器  -->
    <div id="root">
        姓:<input type="text" v-model="firstName"> <br/>
        名:<input type="text" v-model="lastName"> <br/>
        姓名: <span>{{ firstName.substring(0,3) }}- {{lastName}}</span>
    </div>
</body>

<script type="text/javascript">
    new Vue({
        el: '#root',
        data: {
            firstName: '呆',
            lastName: '大王'
        }
    })
</script>
</html>